dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle invalid language code gracefully in Language::fetchLanguageNames
[lhc/web/wiklou.git]
/
languages
/
Language.php
diff --git
a/languages/Language.php
b/languages/Language.php
index
bf30455
..
f686a37
100644
(file)
--- a/
languages/Language.php
+++ b/
languages/Language.php
@@
-857,6
+857,11
@@
class Language {
include "$IP/languages/Names.php";
}
include "$IP/languages/Names.php";
}
+ // If passed an invalid language code to use, fallback to en
+ if ( $inLanguage !== null && !Language::isValidCode( $inLanguage ) ) {
+ $inLanguage = 'en';
+ }
+
$names = array();
if ( $inLanguage ) {
$names = array();
if ( $inLanguage ) {